import '@tarojs/async-await'
import Taro, { Component, Config } from '@tarojs/taro'
import { Provider } from '@tarojs/redux'

import LaunchMainPage from './pages/launch/main'

import configStore from './redux/store'

import './project.config'
import './app.less'

const store = configStore()

class App extends Component {

  config: Config = {
    pages: [
      'pages/launch/main/index',
      'pages/launch/home/index',
      'pages/launch/login/index',
      'pages/launch/apply/edit/index',
      'pages/launch/apply/success/index',
      'pages/tabbar/home/index',
      'pages/tabbar/goods/index',
      'pages/tabbar/discover/index',
      'pages/tabbar/cart/index',
      'pages/tabbar/mine/index',
      'pages/goods/detail/index',
      'pages/goods/list/index',
      'pages/goods/search/index',
      'pages/goods/result/index',
      'pages/discover/detail/index',
      'pages/discover/search/index',
      'pages/discover/result/index',
      'pages/order/preview/index',
      'pages/order/menu/index',
      'pages/order/result/index',
      'pages/order/list/index',
      'pages/order/detail/index',
      'pages/order/search/form/index',
      'pages/order/search/result/index',
      'pages/order/returns/form/index',
      'pages/order/returns/detail/index',
      'pages/other/store/info/index',
      'pages/other/store/invoice/index',
      'pages/other/member/level/index',
      'pages/other/setting/index',
      'pages/other/chpwd/index',
      'pages/other/mobile/validate/index',
      'pages/other/mobile/bind/index',
      'pages/other/wechat/bind/index',
      'pages/other/feedback/index',
      'pages/other/favorites/index',
      'pages/other/purchase/index',
      'pages/other/evaluate/list/index',
      'pages/other/evaluate/form/index',
      'pages/other/message/list/index',
      'pages/other/message/repost/index',
      'pages/other/message/feedback/index',
      'pages/other/integral/index',
      'pages/other/statistics/index',
      'pages/other/help/list/index',
      'pages/other/help/detail/index',
      'pages/other/logistics/index'
    ],
    window: {
      backgroundTextStyle: 'dark',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: '银河系',
      navigationBarTextStyle: 'black',
      backgroundColor: '#f4f4f4'
    },
    tabBar: {
      color: '#262626',
      selectedColor: '#934900',
      list: [
        {
          text: '首页',
          pagePath: 'pages/tabbar/home/index',
          iconPath: 'images/ic_tabbar_home_nor.png',
          selectedIconPath: 'images/ic_tabbar_home_pre.png'
        }, {
          text: '商品',
          pagePath: 'pages/tabbar/goods/index',
          iconPath: 'images/ic_tabbar_goods_nor.png',
          selectedIconPath: 'images/ic_tabbar_goods_pre.png'
        }, {
          text: '发现',
          pagePath: 'pages/tabbar/discover/index',
          iconPath: 'images/ic_tabbar_discover_nor.png',
          selectedIconPath: 'images/ic_tabbar_discover_pre.png'
        }, {
          text: '购物车',
          pagePath: 'pages/tabbar/cart/index',
          iconPath: 'images/ic_tabbar_cart_nor.png',
          selectedIconPath: 'images/ic_tabbar_cart_pre.png'
        }, {
          text: '我的',
          pagePath: 'pages/tabbar/mine/index',
          iconPath: 'images/ic_tabbar_mine_nor.png',
          selectedIconPath: 'images/ic_tabbar_mine_pre.png'
        }
      ]
    }
  }

  render () {
    return (
      <Provider store={store}>
        <LaunchMainPage />
      </Provider>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
